import React from "react";
import {Button, NativeSyntheticEvent, NativeTouchEvent, StyleSheet, View} from "react-native";
import {ScreenDimensions} from "../../libs/utils/ScreenDimensions";


type EButtonProp = {
    style?:any,
    title:string,
    onPress: (ev: NativeSyntheticEvent<NativeTouchEvent>) => void;
    color?: string;
}

type EButtonState = {

}

export default class EButton extends React.Component<EButtonProp, EButtonState> {
    constructor(props:EButtonProp) {
        super(props);
    }


    render() {
        return (
            <View style={[styles.container,this.props.style ? this.props.style : {}]}>
                <Button title={this.props.title} color={this.props.color ? this.props.color : ScreenDimensions.themeBtnColor} onPress={(e)=>this.props.onPress(e)}/>
            </View>

        );
    }
}

let styles = StyleSheet.create({
    container:{
        margin:4,
        backgroundColor:ScreenDimensions.themeBackgroundColor
    },
});
